home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 8
/
QRZ Ham Radio Callsign Database - Volume 8.iso
/
pc
/
files
/
t_unix
/
bs941029.tgz
/
bbsx-941029.tar
/
bbsx
/
bbs.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-29
|
8KB
|
305 lines
/* @(#) $Header: /home/dg1rtf/tcp/bbsx/RCS/bbs.h,v 1.4 1994/10/29 15:18:25 root Exp $ */
#ifndef BBS_H
#define BBS_H
#define BBSX_REVISION "1.6"
#define REVISION_DATE "29.10.1994"
#define BIDFILE "seqbid"
#define CONFIGFILE "config"
#define LIFEFILE "lifetime"
#define ALIASFILE "bbsalias"
#define HELPFILE "help"
#define INDEXFILE "index"
#define LOGFILE "read_"
#define WELCOMEMSG ".welcome"
#define LOCKFILE "lock"
#define MAILFILE "isuser"
#define WRKDIR "/users/bbs"
#define DEBUGFILE "/tmp/bbs.debug"
#define INFOFILE "/usr/local/lib/station.data"
#define MASTERRCFILE "/usr/local/lib/bbsrc"
#define HUSHFILE ".hush_bbs"
#define RCFILE ".bbsrc"
#define SEQFILE ".bbsseq"
#define UUENCODE "/usr/bin/uuencode"
#define UUDECODE "/usr/bin/uudecode"
#define EDITOR "vi"
#define BID_DB "bid"
#define TEMP_BID_DB BID_DB ".tmp"
#define LEN_BID 12
#define LEN_SUBJECT 80
#define LEN_TO 8
#define LEN_AT 8
#define LEN_FROM 8
#define SECONDS (1L)
#define MINUTES (60L*SECONDS)
#define HOURS (60L*MINUTES)
#define DAYS (24L*HOURS)
#define USER 0
#define MBOX 1
#define ROOT 2
#define BBS 0
#define MAILorNEWS 1
#define DELETED 1
#define BINARY 0x80
#define calleq(c1, c2) (!Strcasecmp((c1), (c2)))
#define halt() errorstop(__LINE__)
#define uchar(x) ((x) & 0xff)
#if defined(_SC_OPEN_MAX) && !defined(__386BSD__)
#define open_max() sysconf(_SC_OPEN_MAX)
#else
#define open_max() (1024)
#endif
enum interface_type { wampes, diebox };
struct revision {
char number[16];
char date[16];
char time[16];
char author[16];
char state[16];
};
struct user {
char *name;
uid_t uid;
gid_t gid;
char *dir;
char *shell;
char *cwd;
int seq;
};
struct strlist {
struct strlist *next;
char str[1];
};
struct mail {
char from[1024];
char to[1024];
char orig_to[1024];
char subject[1024];
char bid[1024];
char mid[1024];
char bin;
long date;
int lifetime;
struct strlist *head;
struct strlist *tail;
};
struct dir_entry {
struct dir_entry *left, *right;
int count;
char to[LEN_TO+1];
};
struct index {
long size;
long date;
int mesg;
char bid[LEN_BID+1];
char lifetime_h;
char subject[LEN_SUBJECT+1];
char lifetime_l;
char to[LEN_TO+1];
char orig_to[LEN_TO+1];
char at[LEN_AT+1];
char from[LEN_FROM+1];
char flags;
};
struct cmdtable {
const char *name;
void (*fnc)(int argc, char **argv);
int argc;
int level;
} ;
struct aliastable {
char orig[256];
char alias[256];
char is_std;
int level;
struct aliastable *next;
} ;
struct log {
char to[LEN_TO+1];
long time;
unsigned bytes;
int uid;
};
extern char *optarg;
extern int optind;
extern char Myhostname[];
extern char myhostname[];
extern char prompt[1024] ;
extern const char daynames[] ;
extern const char monthnames[] ;
extern int debug;
extern int doforward;
extern int errors;
extern int fdindex;
extern int fdlock;
extern int fdlog;
extern int fdseq;
extern int level;
extern int mode;
extern int packetcluster;
extern struct revision revision;
extern struct user user;
extern volatile int stopped;
extern struct passwd *bbs_adm;
extern int is_bbs_adm;
extern int is_tell_user;
extern char compressext[];
extern char compress[];
extern char uncompressoption[];
extern char compressoption[];
extern char bbsadm[];
extern char telluser[];
extern char mydomain[];
extern char station[];
extern struct aliastable aliastable[];
extern const struct cmdtable cmdtable[];
extern char binary_allowed;
extern char subject_in_send;
extern struct aliastable *alias_table;
extern enum interface_type interface_type;
extern char last_board[LEN_TO+1];
extern char escape_char;
extern char orig_escape;
extern int lowest_on_start;
extern int highest_on_start;
extern char editor[256];
extern int log_reading;
extern int dir_column;
extern int max_list;
extern int fix_allowed;
extern char debugfile[];
extern char helpfile[];
extern char infofile[];
extern char masterrcfile[];
extern char mailfile[];
extern char boxpassword[];
extern int password_ok;
/* In bbs.c: */
void errorstop(int line);
int Xtolower(int c);
int Xtoupper(int c);
char *strupc(char *s);
char *strlwc(char *s);
int Strcasecmp(const char *s1, const char *s2);
int Strncasecmp(const char *s1, const char *s2, int n);
char *strtrim(char *s);
const char *strcasepos(const char *str, const char *pat);
char *getstring(char *s);
char *timestr(long gmt);
char *rfc822_date(long gmt);
long parse_date(const char *str);
void make_parent_directories(const char *filename);
char *getfilename(int mesg);
void get_seq(void);
void put_seq(void);
void wait_for_prompt(void);
int get_index(int n, struct index *index);
int read_allowed(const struct index *index);
char *get_user_from_path(char *path);
char *get_host_from_path(char *path);
int msg_uniq(const char *bid, const char *mid);
void send_to_bbs(struct mail *mail);
void send_to_mail(struct mail *mail);
void send_to_news(struct mail *mail);
void fix_address(char *addr);
struct mail *alloc_mail(void);
void free_mail(struct mail *mail);
void route_mail(struct mail *mail);
void append_line(struct mail *mail, char *line);
int get_header_value(const char *name, int do822, char *line, char *value);
char *get_host_from_header(const char *line);
int host_in_header(char *fname, char *host);
void alias_command(int argc, char **argv);
void bye_command(int argc, char **argv);
void change_command(int argc, char **argv);
void delete_command(int argc, char **argv);
void destroy_command(int argc, char **argv);
void dir_print(struct dir_entry *p);
void dir_command(int argc, char **argv);
void disconnect_command(int argc, char **argv);
void forward_message(const struct index *index, const char *filename,
const char *at, int skip_header);
void f_command(int argc, char **argv);
void help_command(int argc, char **argv);
void hide_command(int argc, char **argv);
void info_command(int argc, char **argv);
void list_command(int argc, char **argv);
void mail_command(int argc, char **argv);
void move_command(int argc, char **argv);
void mybbs_command(int argc, char **argv);
void quit_command(int argc, char **argv);
void read_command(int argc, char **argv);
void reply_command(int argc, char **argv);
void send_command(int argc, char **argv);
void set_command(int argc, char **argv);
void shell_command(int argc, char **argv);
void sid_command(int argc, char **argv);
void source_command(int argc, char **argv);
void status_command(int argc, char **argv);
void tell_command(int argc, char **argv);
void undelete_command(int argc, char **argv);
void unknown_command(int argc, char **argv);
void unset_command(int argc, char **argv);
void write_command(int argc, char **argv);
void xcrunch_command(int argc, char **argv);
void xscreen_command(int argc, char **argv);
char *connect_addr(char *host);
void connect_bbs(void);
void parse_command_line(char *line);
void bbs(void);
void interrupt_handler(int sig);
void alarm_handler(int sig);
void recv_from_mail_or_news(void);
void getalias(char *original);
int forward_allowed(const struct index *index,const char * name);
int send_allowed(const struct mail *mail,const char *at,const char * name);
int read_config(void);
int send_binary(struct mail *mail, char *line);
int do_crc(char *buf, int n, unsigned int crc);
int uudecode(FILE *fp, char *line);
void init_aliasdb(void);
void check_cmdaliases(char *line);
void insert_alias(const char *orig, const char *alias,
const int level, char is_std);
void get_welcomemsg(void);
int get_lowest_mesg(int argc, char **argv);
int get_highest_mesg(int argc, char **argv);
int mesg_in_command(int argc, char **argv, int mesg, struct index *index);
int get_lowest_on_start(void);
int get_highest_on_start(void);
int Atoi(char *str);
int forward_mail(void);
int isvaliduser(char *s);
int has_passwd(char *call);
int get_passwd(char *call, char *timestamp, char *password);
#endif /* of BBS_H */